﻿var clients = [];
$(function () {
    $.clientsInit = function () {
        var dataJson = {
            dataItems: [],
            organize: [],
            role: [],
            duty: [],
            user: [],
            authorizeMenu: [],
            authorizeButton: []
        };
        var init = function () {
            $.ajax({
                url: "/Client/GetMenuJson?time="+new Date().getTime(),
                type: "get",
                dataType: "json",
                async: false,
                success: function (data) {
                    dataJson.dataItems = data.dataItems;
                    dataJson.organize = data.organize;
                    dataJson.role = data.role;
                    dataJson.duty = data.duty;
                    dataJson.authorizeMenu = eval(data.authorizeMenu);
                    dataJson.authorizeButton = data.authorizeButton;
                }
            });
        }
        init();
        return dataJson;
    };
    clients = $.clientsInit();
});
